import request from '@/utils/request'

// 查询机台吨位列表
export function listMachineTons(query) {
  return request({
    url: '/base/machineTons/list',
    method: 'get',
    params: query
  })
}

// 查询机台吨位详细
export function getMachineTons(mtId) {
  return request({
    url: '/base/machineTons/' + mtId,
    method: 'get'
  })
}

// 新增机台吨位
export function addMachineTons(data) {
  return request({
    url: '/base/machineTons',
    method: 'post',
    data: data
  })
}

// 修改机台吨位
export function updateMachineTons(data) {
  return request({
    url: '/base/machineTons',
    method: 'put',
    data: data
  })
}

// 删除机台吨位
export function delMachineTons(mtId) {
  return request({
    url: '/base/machineTons/' + mtId,
    method: 'delete'
  })
}

// 导出机台吨位
export function exportMachineTons(query) {
  return request({
    url: '/base/machineTons/export',
    method: 'get',
    params: query
  })
}
//修改状态
export function changeMacFlag(mtId, mtFlag){

  const data = {
    mtId,
    mtFlag
  }
  return request({
    url: '/base/machineTons/changeMacFlag',
    method: 'put',
    data: data
  })
}
//根据输入的值获得机台吨位
export function getTonsByCode(query) {
  return request({
    url: '/base/machineTons/getTonsByCode',
    method: 'get',
    params: query
  })
}
